#pragma once

#if defined(_WIN64) || defined(_WIN32)
typedef char           sfif_int8_t;
typedef unsigend char  sfif_uint8_t;

typedef short          sfif_int16_t;
typedef unsigned short sfif_uint16_t;

typedef long           sfif_int32_t;
typedef unsigned long  sfif_uint32_t;

typedef long long      sfif_int64_t;
typedef unsigned long  sfif_uint64_t;

#else

#include <stdint.h>

typedef int8_t         sfif_int8_t;
typedef uint8_t        sfif_uint8_t;

typedef int16_t        sfif_int16_t;
typedef uint16_t       sfif_uint16_t;

typedef int32_t        sfif_int32_t;
typedef uint32_t       sfif_uint32_t;

typedef int64_t        sfif_int64_t;
typedef uint64_t       sfif_uint64_t;

#endif

typedef int            sfif_int_t;
typedef unsigned int   sfif_uint_t;

#if SFIF_FLOAT_DOUBLE_PRECISION == 1
    typedef double     sfif_float_t;
#else
    typedef float      sfif_float_t;
#endif

// 32 bit float 
typedef float           sfif_float32_t;

typedef sfif_uint16_t   sfif_pixel;

typedef sfif_int_t      sfif_coord_t;

#ifndef __cplusplus
  typedef bool            sfif_bool_t;

  const sfif_bool_t  SFIF_FALSE=false;
  const sfif_bool_t  SFIF_TURE =true; 
#else
 typedef sfif_int_t sfif_bool_t;

 const sfif_bool_t  SFIF_FALSE=0;
 const sfif_bool_t  SFIF_TURE =1;
#endif

inline sfif_bool_t
sfif_make_bool(sfif_bool_t x){
  return (x==1)?SFIF_TURE:SFIF_FALSE;
}
